package com.iplant.pdm.service.basicenum.fpc;

import com.iplant.base.po.enums.BaseEnum;

/**
 * 互检模式
 *
 * @author YouWang·Peng
 * 2023-12-14 20:33:07
 */
public enum FPCMutualModel implements BaseEnum {
    /**
     * 本工序互检
     */
    DEFAULT(0, "本工序互检"),
    /**
     * 下工序互检
     */
    NextCheck(1, "下工序互检");

    private int value;
    private String label;
    private String remark;

    FPCMutualModel(int value, String label) {
        this.value = value;
        this.label = label;
    }

    FPCMutualModel(int value, String label, String remark) {
        this.value = value;
        this.label = label;
        this.remark = remark;
    }

    /**
     * 通过 value 的数值获取枚举实例
     */
    public static FPCMutualModel getEnumType(int val) {
        for (FPCMutualModel type : FPCMutualModel.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return DEFAULT;
    }

    /**
     * 通过 value 的数值获取枚举实例
     */
    public static FPCMutualModel getEnumType(String val) {
        for (FPCMutualModel type : FPCMutualModel.values()) {
            if (type.getLabel().equals(val)) {
                return type;
            }
        }
        return DEFAULT;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}